import request from '@/config/axios'

// 试卷题库关联 VO
export interface PaperQuestionBankVO {
  id: number // 主键
  paperId: number // 试卷ID
  bankId: number // 题库ID
}

// 试卷题库关联 API
export const PaperQuestionBankApi = {
  // 查询试卷题库关联分页
  getPaperQuestionBankPage: async (params: any) => {
    return await request.get({ url: `/exam/paper-question-bank/page`, params })
  },

  // 查询试卷题库关联详情
  getPaperQuestionBank: async (id: number) => {
    return await request.get({ url: `/exam/paper-question-bank/get?id=` + id })
  },

  // 新增试卷题库关联
  createPaperQuestionBank: async (data: PaperQuestionBankVO) => {
    return await request.post({ url: `/exam/paper-question-bank/create`, data })
  },

  // 修改试卷题库关联
  updatePaperQuestionBank: async (data: PaperQuestionBankVO) => {
    return await request.put({ url: `/exam/paper-question-bank/update`, data })
  },

  // 删除试卷题库关联
  deletePaperQuestionBank: async (id: number) => {
    return await request.delete({ url: `/exam/paper-question-bank/delete?id=` + id })
  },

  // 导出试卷题库关联 Excel
  exportPaperQuestionBank: async (params) => {
    return await request.download({ url: `/exam/paper-question-bank/export-excel`, params })
  },
}